#!/bin/sh

VERSION="$(cat data/eversion)"
CFG="/home/jls/core17/exquisite.cfg"
ISO="/mnt/sda1/boot/iso/exquisite.iso"

if [ ! -f /usr/local/tce.installed/ezremaster ]; then
   if [ ! -e /etc/sysconfig/tcedir/optional/ezremaster.tcz ]; then
      tce-load -w ezremaster
   fi
      tce-load -is ezremaster
fi
sudo rm -rf ezremaster/*
#echo -n "Press Enter key."
#read gagme
remaster.sh $CFG checkimage
remaster.sh $CFG extractimage
#echo -n "Press Enter key."
#read gagme
#remaster.sh $1 bootcode
remaster.sh $CFG apps
sudo cp data/tc-config ezremaster/extract/etc/init.d/
sudo cp data/tce-setup ezremaster/extract//usr/bin/
sudo cp data/eversion  ezremaster/extract/usr/share/doc/tc/erelease.txt
#echo -n "Press Enter key."
#read gagme
remaster.sh $CFG package
mv ezremaster/ezremaster.iso "$ISO"
